package com.wrx.server.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wrx.server.pojo.RespBean;
import com.wrx.server.pojo.User;
import com.wrx.server.pojo.UserLoginParam;
import com.wrx.server.pojo.UserRegisterParam;

import javax.servlet.http.HttpServletRequest;
import java.security.Principal;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author wrx
 * @since 2021-03-26
 */
public interface IUserService extends IService<User> {

    /**
     * 登陆之后返回token
     * @param username
     * @param password
     * @param code
     * @param request
     * @return
     */
    RespBean login(String username, String password, String code, HttpServletRequest request);

    /**
     * 用户注册
     * @param userRegisterParam
     * @param request
     * @return
     */
    public RespBean register(UserRegisterParam userRegisterParam, HttpServletRequest request);


    /**
     * 根据用户名获取用户
     * @param username
     * @return
     */
    User getUserByUserName(String username);

    /**
     * 判断用户是否登录且获取登录状态
     * @param principal
     * @return
     */
    public User getUserInfo(Principal principal);
}
